﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;
using System.Windows.Media.Imaging;

namespace MangaKurosagi
{
    public class StoriesFarvious : Stories
    {
        public BitmapImage ImageSource
        {
            get { return new BitmapImage(new Uri(this.UrlImage)); }
        }
        public StoriesFarvious ConvertTo(Stories stories)
        {
            return new StoriesFarvious { Title = stories.Title, Description = stories.Description, Url = stories.Url, UrlImage = stories.UrlImage, Update = true };
        }
        public static List<StoriesFarvious> ConvertTo(List<Stories> stories)
        {
            List<StoriesFarvious> Result = new List<StoriesFarvious>();
            foreach (Stories item in stories)
            {
                StoriesFarvious stf = new StoriesFarvious { Title = item.Title, Description = item.Description, Url = item.Url, UrlImage = item.UrlImage, Update = true };
                Result.Add(stf);
            }
            return Result;
        }
        public static Stories Convert(StoriesFarvious stf)
        {
            return new Stories() { Title = stf.Title, Description = stf.Description, Url = stf.Url, UrlImage = stf.UrlImage, Update = stf.Update };
        }
    }
}
